home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / netBoot / sun3src / cmp.s < prev    next >
Encoding:
Text File  |  1988-05-13  |  1.4 KB  |  60 lines

  1.  
  2. |
  3. |    @(#)cmp.s 1.1 86/09/27
  4. |    Copyright (c) 1986 by Sun Microsystems, Inc.
  5. |
  6. |    these routines compare memory blocks
  7. |
  8. |    [b|w|l]cmp(address, address, size)
  9. |        uses loop mode access to compare the specified blocks
  10. |        with the proper size access
  11. |
  12.  
  13.     .text
  14.     .globl    _bcmp, _wcmp, _lcmp
  15.  
  16.     .globl    bdb_unpack, wdb_unpack, ldb_unpack
  17.     .globl    bdb_pack, wdb_pack, ldb_pack
  18.  
  19. cmpstart:
  20.     movl    sp@+, a1
  21.     link    a6, #0
  22.     movl    a1, sp@-
  23.     movl    a6@(16), d0        | get count
  24.     tstl    d0            | if count zero, return now
  25.     beqs    cmpend
  26.     movl    a6@(8), a0        | get first block address
  27.     movl    a6@(12), a1        | get second block address
  28.     rts
  29.  
  30. cmpend:
  31.     unlk    a6
  32.     rts
  33.  
  34. _bcmp:
  35.     jsr    cmpstart        | set up cmp registers
  36.     jsr    bdb_unpack        | get d0 setup for dbra
  37. 1$:    cmpmb    a0@+, a1@+        | compare
  38.     dbne    d0, 1$            | decrement until not equal
  39.     dbne    d1, 1$            | decrement until not equal
  40.     jsr    bdb_pack        | repack db count
  41.     jra    cmpend            | do cleanup
  42.  
  43. _wcmp:
  44.     jsr    cmpstart        | set up cmp registers
  45.     jsr    wdb_unpack        | get d0 setup for dbra
  46. 1$:    cmpmw    a0@+, a1@+        | compare
  47.     dbne    d0, 1$            | decrement until not equal
  48.     dbne    d1, 1$            | decrement until not equal
  49.     jsr    wdb_pack        | repack db count
  50.     jra    cmpend            | do cleanup
  51.  
  52. _lcmp:
  53.     jsr    cmpstart        | set up cmp registers
  54.     jsr    ldb_unpack        | get d0 setup for dbra
  55. 1$:    cmpml    a0@+, a1@+        | compare
  56.     dbne    d0, 1$            | decrement until not equal
  57.     dbne    d1, 1$            | decrement until not equal
  58.     jsr    ldb_pack        | repack db count
  59.     jra    cmpend            | do cleanup
  60.